package com.mall.service;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.dao.client.DaoManager;
import com.mall.ibatis.bean.Brand;
import com.mall.ibatis.bean.JqgridParams;
import com.mall.ibatis.persistence.DaoConfig;
import com.mall.ibatis.persistence.iface.BrandDao;

public class BrandService {
	private DaoManager daoManager = DaoConfig.getDaomanager();
	BrandDao brDao;
	
	public BrandService(){
		brDao = (BrandDao) daoManager.getDao(BrandDao.class);
		
	}

	public List<Brand> showBrands(JqgridParams params) {
		return brDao.showBrands(params);
	}

	public int showBrandsCount(JqgridParams params) {
		return brDao.showBrandsCount(params);
	}

	public String addBrand(Brand brand) {		
		return brDao.addBrand(brand);
	}

	public String deleteBrand(String rowID) throws SQLException {
		return brDao.deleteBrand(rowID);
	}

	public String saveBrand(List<Brand> brList) {
		return brDao.saveBrand(brList);
	}
	
}
